package com.chenqq.qsocket.handler;

import com.chenqq.qsocket.listener.SocketMessageListener;
import com.chenqq.qsocket.message.RefuseReceiveFileMessage;
import com.chenqq.qsocket.message.SocketMessage;
import com.chenqq.qsocket.tools.LogShow;

import org.apache.mina.core.session.IoSession;
import org.json.JSONException;


public class RefuseReceiveFileMessageHandler extends FileMessageHandler{

	@Override
	public void handleMessage(SocketMessage msg, IoSession session) throws JSONException {
		RefuseReceiveFileMessage refuseReceiveFileMessage = new RefuseReceiveFileMessage(msg);
		RefuseReceiveFileMessage.RefuseInfo refuseInfo = refuseReceiveFileMessage.getRefuseInfo();
		if (socketMessageListener!=null){
			socketMessageListener.showFileInfo(tag,"服务器拒绝接收文件 errorCode : "+refuseInfo.errorCode+" des : "+refuseInfo.description);
		}
		LogShow.showV("服务器拒绝接收文件 errorCode : "+refuseInfo.errorCode+" des : "+refuseInfo.description);
		removeFileTask(refuseInfo.id,false);
	}

}
